/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package seso;

import java.awt.Font;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.ImageIcon;

/**
 *
 * @author Administrator
 */
public class RDialogShortcutButton extends javax.swing.JButton {
    ImageIcon icon = Util.getUserImageIcon("resources/DlgShortcutIcon.png");
    boolean isFirstTime = true;

    public RDialogShortcutButton() {
        super();

        setFont(new Font("Arial", Font.PLAIN, 11));
        setBorder(null);
        setBorderPainted(false);
        setContentAreaFilled(false);
        setFocusPainted(false);
        setFocusable(false);
        setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        
        setHorizontalAlignment(javax.swing.SwingConstants.LEADING);
        setVerticalAlignment(javax.swing.SwingConstants.TOP);
        setVerticalTextPosition(javax.swing.SwingConstants.TOP);
        
        setSize(120, 20);
        setPreferredSize(new Dimension(120, 20));
    }

    @Override
    protected void paintComponent(Graphics g) {
        if (isFirstTime || java.beans.Beans.isDesignTime()) {
            isFirstTime = false;
            setIcon(icon);
        }
        super.paintComponent(g);
    }
    
}
